<template>
  <div>
    <section>1. git官方安装</section>
    <section>
      2.
      <section>mkdir learngit</section>
      <section>cd learngit</section>
      <section>pwd</section>
      <section>(pwd命令用于显示当前目录)</section>
    </section>
    <section>
      3.
      <section>git init</section>
      <section>通过git init命令把这个目录变成Git可以管理的仓库：</section>
      <section>git add readme.txt (把文件添加到仓库)</section>
      <section>git add . (全部添加到缓存区)</section>
      <section>git commit -m "wrote a readme file" (提交)</section>
      <section>git push -u origin master (推送到远程,第一次推动添加-u)</section>
    </section>
    <section>
      4.
      <section>
        git remote add origin git@github.com:michaelliao/learngit.git;
      </section>
      <section>git clone git@github.com:michaelliao/learngit.git;</section>
      <section>
        可以从这个仓库克隆出新的仓库，也可以把一个已有的本地仓库与之关联，然后，把本地仓库的内容推送到GitHub仓库。
      </section>
    </section>
    <section>
      5.
      <section>git pull</section>
      <section>将远程分支拉取到本地</section>
    </section>
    <section>
      6.
      <section>git branch (查看所有分支)</section>
    </section>
    <section>
      7.
      <section>git branch dev (本地创建分支)</section>
    </section>
    <section>
      8.
      <section>git switch dev (切换分支)</section>
    </section>
    <section>
      9.
      <section>
        git merge dev (在master分支上执行,把dev分支合并到master上)
      </section>
    </section>
    <section>
      10.
      <section>
        git push --set-upstream origin 分支名 (推送本地分支到远程仓库)
      </section>
    </section>
    <section>
      11.
      <section>
        ssh-keygen -t ed25519 -C "xxxxx@xxxxx.com" (生成秘钥:在git bash下执行)
      </section>
    </section>
    <section>
      12.
      <section>git remote (查看远程库的信息)</section>
    </section>
    <section>
      13.
      <section>git push origin dev</section>
      <section>
        推送分支，就是把该分支上的所有本地提交推送到远程库。推送时，要指定本地分支，这样，Git就会把该分支推送到远程库对应的远程分支上：
      </section>
    </section>
    <section>
      14.
      <section>git branch -d dev (删除本地分支)</section>
    </section>
    <section>
      15.
      <section>git push origin --delete dev (删除远程分支)</section>
    </section>
    <section>
      16.
      <section>
        git branch -a (查看所有分支包括远程分支，远程分支用红色标识。)
      </section>
    </section>
    <section>git rm -r --cached .</section>
    <section>git config core.autocrlf false</section>
    <section>
      解决 The file will have its original line endings in your working
      directory 首先出现这个问题主要原因是：我们从别人github地址上通过git
      clone下载下来，而又想git
      push到我们自己的github上，那么就会出现上面提示的错误信息
    </section>
    <section>
      git add .没有反映，我不得不强制退出了。
      由于我这个上传项目太大，导致其陷入了一种类似死锁的状态 解决办法
      执行 rm -f ./.git/index.lock
    </section>
  </div>
</template>
<script>
export default {
  name: "HelloWorld",
  data() {
    return {};
  },
};
</script>

<style scoped>
</style>
